
/* Generated by Interface Builder */

#import "EyeApp.h"
#import "EyeView.h"
#import <appkit/Window.h>
#import <dpsclient/dpsclient.h>

#define BORDER	3
#define TIME	0.02

extern void startTimer(DPSTimedEntry, double, id), notifyTimer(DPSTimedEntry, double, id);

@implementation EyeApp

- run
{
    timedEntry = DPSAddTimedEntry(1.0L, (DPSTimedEntryProc) &startTimer, self, NX_BASETHRESHOLD);
    
    return [super run];
}

- initializeIcon:icon
{
    NXRect cRect, fRect;
    id view;

    DPSRemoveTimedEntry(timedEntry);

    [icon getFrame:&fRect];
    
    [Window getContentRect:&cRect forFrameRect:&fRect style:[icon style]];
 
     cRect.origin.x = BORDER;
     cRect.origin.y = BORDER;
     cRect.size.width -= BORDER * 2;
     cRect.size.height -= BORDER * 2;
     
    [[icon contentView] addSubview:(view = [EyeView newFrame:&cRect])];

    [view init];

    [view drawBalls];
    
    timedEntry = DPSAddTimedEntry((double) TIME, (DPSTimedEntryProc) &notifyTimer, view, NX_BASETHRESHOLD);

    return self;
}

@end
